@Service
public class SongService {
    @Autowired
    private SongRepository songRepository;

    public List<SongDetailDTO> getAllSongDetails() {
        List<Song> songs = songRepository.findAll();
        // 将 Song 转换为 SongDetailDTO，只保留需要的字段
        List<SongDetailDTO> songDetails = songs.stream()
            .map(song -> new SongDetailDTO(song.getId(), song.getName(), song.getArtist(), song.getAlbum()))
            .collect(Collectors.toList());
        return songDetails;
    }
}
